﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Cole.Entities;
using Cole.Service;

namespace Cole.GUI.Grado_Seccion
{
    public partial class FrmNuevoGrado : Form
    {
        private IGradoBl gradoBl;                
        public FrmNuevoGrado()
        {
            InitializeComponent();
            if (gradoBl == null)
            {
                gradoBl = new GradoBl();
            }
        }


        private void FrmNuevoGrado_Load(object sender, EventArgs e)
        {

        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            var grado = gradoBindingSource.Current as Grado;

            gradoBl.nuevoGrado(grado);
            

            MessageBox.Show(this, "Los Datos se guardaron correctamente!!! ","Mensaje" ,
                         MessageBoxButtons.OK);

            Close();

        }
        public void nuevo()
        {
            gradoBindingSource.AddNew();
        }

        private void btnCancelar_Click(object sender, EventArgs e)
        {
            Close();

        }
    }
}
